<template>
  <div class="right">
    <van-grid :gutter="10" column-num='3'>
      <van-grid-item
        v-for="item in categoryRightList"
        :key="item.id"
        :icon="item.imageUrl"
        :text="item.title"
      />
    </van-grid>
  </div>
</template>

<script>
import { getCategoryRight } from '@/api/category'
export default {
  name: 'right',
  data() {
    return {
      categoryRightList: [],
    }
  },
  watch: {
    $route: {
      async handler() {
        const id = this.$route.query.id
        const { categories } = await getCategoryRight(id)
        this.categoryRightList = categories
      },
      deep: true,
      immediate: true,
    },
  },
}
</script>

<style lang="scss" scoped>
</style>
